using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Gameplay 
{
   
    public abstract class Skill : ScriptableObject
    {
        public SkillConfig Config;
        protected Character _user;
        protected Animator _animator;
        protected Rigidbody _rb;
        
        public virtual void Use(Character user) 
        {
            _user = user;
            _animator = user.Anim;
            _rb = user.RB;
            
            _animator.SetTrigger("SkillTrigger");
            _animator.SetInteger("SkillNum",Config.Id);
        }
        public virtual void Begin() 
        {
            _user.Attacking = true;
            _rb.velocity = Vector3.zero;
        }
        public virtual void Update() {}
        public virtual void Trigger() 
        {
            if (Config.effectSound != null) 
            {
                AudioManager.Instance.PlaySound(Config.effectSound);
            }
            
        }
        public virtual void Finish() { }
        public virtual void End() 
        {
            _user.Attacking = false;
          
        }

        public virtual void Canel()
        {
            
        }
    }
}

